package com.wuka;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.web.servlet.ServletComponentScan;

/**
 * 程序执行入口!
 *
 */
@SpringBootApplication 
@ServletComponentScan
@MapperScan("com.wuka.mapper")  
public class Application implements EmbeddedServletContainerCustomizer
 {
	private static int port = 8080;
	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}

	/**
	 * http://localhost:8080/test/freemarker
	 * 实现了接口EmbeddedServletContainerCustomizer，重写customize方法即可直接运行类启动
	 */
	@Override
	public void customize(ConfigurableEmbeddedServletContainer container) {
		container.setPort(port);
		container.setDisplayName("伍咖");
	}
}
